package com.freepay.infrastructure.persistence;


import se.citerus.dddsample.infrastructure.persistence.hibernate.HibernateRepository;
import org.springframework.stereotype.Repository;
import com.freepay.domain.model.factura.Factura;
import com.freepay.domain.model.factura.FacturaRepository;


@Repository
public class FacturaRepositoryHibernate  extends HibernateRepository implements FacturaRepository {

  @Override
  public Factura getInstance(int codigo) {
    return (Factura) getSession().
      createQuery("from Factura where codigo= :codigo").
      setParameter("codigo", codigo).
      uniqueResult();
  }  
  
}
